package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PropertyNoticeMapper;
import com.ruoyi.system.domain.PropertyNotice;
import com.ruoyi.system.service.IPropertyNoticeService;

/**
 * 通知公告Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-27
 */
@Service
public class PropertyNoticeServiceImpl implements IPropertyNoticeService 
{
    @Autowired
    private PropertyNoticeMapper propertyNoticeMapper;

    /**
     * 查询通知公告
     * 
     * @param noticeId 通知公告主键
     * @return 通知公告
     */
    @Override
    public PropertyNotice selectPropertyNoticeByNoticeId(Long noticeId)
    {
        return propertyNoticeMapper.selectPropertyNoticeByNoticeId(noticeId);
    }

    /**
     * 查询通知公告列表
     * 
     * @param propertyNotice 通知公告
     * @return 通知公告
     */
    @Override
    public List<PropertyNotice> selectPropertyNoticeList(PropertyNotice propertyNotice)
    {
        return propertyNoticeMapper.selectPropertyNoticeList(propertyNotice);
    }

    /**
     * 新增通知公告
     * 
     * @param propertyNotice 通知公告
     * @return 结果
     */
    @Override
    public int insertPropertyNotice(PropertyNotice propertyNotice)
    {
        propertyNotice.setCreateTime(DateUtils.getNowDate());
        return propertyNoticeMapper.insertPropertyNotice(propertyNotice);
    }

    /**
     * 修改通知公告
     * 
     * @param propertyNotice 通知公告
     * @return 结果
     */
    @Override
    public int updatePropertyNotice(PropertyNotice propertyNotice)
    {
        return propertyNoticeMapper.updatePropertyNotice(propertyNotice);
    }

    /**
     * 批量删除通知公告
     * 
     * @param noticeIds 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deletePropertyNoticeByNoticeIds(Long[] noticeIds)
    {
        return propertyNoticeMapper.deletePropertyNoticeByNoticeIds(noticeIds);
    }

    /**
     * 删除通知公告信息
     * 
     * @param noticeId 通知公告主键
     * @return 结果
     */
    @Override
    public int deletePropertyNoticeByNoticeId(Long noticeId)
    {
        return propertyNoticeMapper.deletePropertyNoticeByNoticeId(noticeId);
    }
}
